<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Cache-control" content="no-cache">

	<%-- CSS Style Declarations --%>
	<link rel ="stylesheet" type="text/css" href="stylesheets/style.css" ></link>
	
		<%-- Java imports --%>
	<%@ page import="java.io.*" %>
	<%@ page import="java.util.*" %>
	<%@ page import="flashcardtest.*" %>
	
	<%-- Get reference to Java Objects --%>
	<% 	User localUser = null;//(User)request.getSession().getAttribute("user");
		//ArrayList<String> userList = (ArrayList<String>)request.getSession().getAttribute("userlist");%>

	<title>Users</title>
</head>

<body>

<div id="center-wrapper">
<div id="center-column">

<!-- Header -->
<div id="header">
<FORM action="tomain" method="post">
			<input
				type="submit"
				name="button1"
				class="headerbutton"
				value="Main Menu"
				title="">
</FORM>
</div> <!-- header -->


<!-- Page Title -->
<div style="
	font-size:30px;
	width: 600px;
	text-align:center;
	position:absolute;
	top:50px;
	">
	Users
</div> <!-- page title -->
	

<!-- Current User Data -->
<% if (localUser != null) { %>
<div style="
	position:absolute;
	top:100px;
	left:260px;
	width:300px;
	text-align:center;
	">
<form action="/FlashCards/Users" method="post">
<textarea rows="11" cols="30" readonly="readonly">
<% //out.println(localUser.DisplayResults()); %>
</textarea>
	
</form>
</div> 
<% }  else { System.out.println("NO USER DATA");}%> <!-- Current User Data -->


<!-- Users List -->
<div style="
	width: 600px;
	text-align:left;
	position:absolute;
	top:100px;
	left: 20px;
	">
<FORM action="user" method="post">
<select multiple size="14" name="User List" style="width:15em">
<% 	//Iterator<String> itr = userList.iterator(); 
		//while (itr.hasNext()) {
			//String aUser = itr.next();
			//out.println("<option value=\"" + aUser + "\">" + aUser + "</option>" );
	//	}%>
	</select><br>
	<input type="submit" name="mode" value="Select User">
	<input type="submit" name="mode" value="Delete User">
</FORM>

</div> <!-- user list -->

<!-- New User Form -->
<form action="user" method="post">
<div style="
	position:absolute;
	top:290px;
	left:260px;
	width:300px;
	text-align:left;
	">
	<fieldset>
	<legend>New User</legend>
	
	Name :
	<input type="text" class="text" size="20" maxlength="20" name="newName" /><br>
	<input type="submit" name="mode" value="Add User" />
	
	</fieldset>
</div>	
</form> <!-- new user form -->

<!-- Message -->
<div style="
	position:absolute;
	top: 100px;
	width: 600px;
	text-align:center;
	">
	<% out.println(request.getSession().getAttribute("message")); %>
</div> <!-- message -->


</div> <!-- center-column -->
</div> <!-- center-wrapper -->
</body>
</html>